<template>
  <h3>route.query方式获取路由参数,url?key=value&key1=value1</h3>
  <p>userId: {{route.query.id}}</p>
  <p>userName: {{route.query.name}}</p>

  <h3>route.params方式获取路由参数,url/:id/:name/:position</h3>
  <p>userId: {{route.params.id}}</p>
  <p>userName: {{route.params.name}}</p>
  <p>position: {{route.params.position}}</p>

  <h3>pinia state获取路由参数</h3>
  <p>userId: {{appStore.state.deptUser.id}}</p>
  <p>userName: {{appStore.state.deptUser.name}}</p>
  <p>position: {{appStore.state.deptUser.position}}</p>
</template>

<script setup>
import {useRoute} from "vue-router/dist/vue-router";
import {useAppStore} from "@/store";

const route = useRoute();
const appStore = useAppStore();

</script>

<style scoped>




</style>